export default function(canvasConfig,labels,data){
    var chartColors = {
        a: '#AAAAAA',
        b: '#59C5B5',
        c: '#A1CF63',
        d: '#F6B326',
        e: '#F5504D',
    };
    var randomScalingFactor = function() {
        return Math.round(Math.random() * 100);
    };

    var chartConfig = {
        type: 'pie',
        data: {
            datasets: [{
                data:data, 
                // [
                //     randomScalingFactor(),
                //     randomScalingFactor(),
                //     randomScalingFactor(),
                //     randomScalingFactor(),
                //     randomScalingFactor(),
                // ],
                backgroundColor: [
                    chartColors.a,
                    chartColors.b,
                    chartColors.c,
                    chartColors.d,
                    chartColors.e,
                ],
                label: ''
            }],
            labels: labels
        },
        options: {
            responsive: true,
            legend: {
                position: 'right',
                labels:{
                    padding:23,
                    usePointStyle:true
                }
            }
        }
    };
    return {
        chartConfig:chartConfig,
        canvasConfig:canvasConfig
    }
}